package com.sinosoft.system.bank.biz.imp;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sinosoft.system.bank.biz.BankPersonalBiz;
import com.sinosoft.system.bank.dao.BankPersonalDao;
import com.sinosoft.system.bank.entity.BankPersonal;
import com.sinosoft.system.util.page.Pagenation;

@Service
@Transactional
public class BankPersonalBizImp implements BankPersonalBiz{

	private static Logger log = Logger.getLogger(BankPersonalBizImp.class);
	
	@Autowired
	private BankPersonalDao bankPersonalDao;
	
	@Override
	public int insertBankPersonal(BankPersonal bankPersonal) {
		log.info("新增BankPersonal数据"+bankPersonal.toString());
		return bankPersonalDao.insertBankPersonal(bankPersonal);
	}

	@Override
	public int updateBankPersonal(BankPersonal bankPersonal) {
		log.info("更新BankPersonal数据"+bankPersonal.toString());
		return bankPersonalDao.updateBankPersonal(bankPersonal);
	}

	@Override
	public int deleteBankPersonal(int id) {
		log.info("删除BankPersonal数据 id="+id);
		return bankPersonalDao.deleteBankPersonal(id);
	}

	@Override
	public BankPersonal selectBankPersonal(int id) {
		log.info("根据ID查询BankPersonal数据 id="+id);
		return bankPersonalDao.selectBankPersonal(id);
	}

	@Override
	public BankPersonal selectBankPersonal(List<String> queryKeys,List<Object> queryValues) {
		log.info("查询BankPersonal数据 ");
		return bankPersonalDao.selectBankPersonal(queryKeys, queryValues);
	}

	@Override
	public int selectCountBankPersonal() {
		log.info("查询BankPersonal数据 总数量");
		return bankPersonalDao.selectCountBankPersonal();
	}

	@Override
	public int selectCountBankPersonal(List<String> queryKeys,List<Object> queryValues) {
		log.info("查询BankPersonal数据 总数量"+queryKeys.toString());
		return bankPersonalDao.selectCountBankPersonal(queryKeys, queryValues);
	}

	@Override
	public List<BankPersonal> selectLimitBankPersonal(int start, int size) {
		log.info("查询BankPersonal数据 limit数量:start="+start+",size="+size);
		return bankPersonalDao.selectLimitBankPersonal(start, size);
	}

	@Override
	public List<BankPersonal> selectLimitBankPersonal(List<String> queryKeys,List<Object> queryValues,int start, int size) {
		log.info("条件查询BankPersonal数据数量");
		return bankPersonalDao.selectLimitBankPersonal(queryKeys, queryValues, start,  size);
	}

	@Override
	public List<BankPersonal> selectAllBankPersonal() {
		log.info("查询所有BankPersonal数据");
		return bankPersonalDao.selectAllBankPersonal();
	}

	@Override
	public List<BankPersonal> selectAllBankPersonal(List<String> queryKeys,List<Object> queryValues) {
		log.info("条件查询所有BankPersonal数据");
		return bankPersonalDao.selectAllBankPersonal(queryKeys, queryValues);
	}

	@Override
	public Pagenation selectPageBankPersonal(Pagenation page) {
		log.info("分页查询所有BankPersonal数据");
		int start =	page.getStartRow();
		int size = page.getPageSize();
		List<BankPersonal> rows = bankPersonalDao.selectLimitBankPersonal(page.getQueryKeys(), page.getQueryValues(),start,size);
		int total = bankPersonalDao.selectCountBankPersonal(page.getQueryKeys(), page.getQueryValues());
		page.setTotal(total);
		page.setRows(rows);
		return page;
	}

	public BankPersonalDao getBankPersonalDao() {
		return bankPersonalDao;
	}

	public void setBankPersonalDao(BankPersonalDao bankPersonalDao) {
		this.bankPersonalDao = bankPersonalDao;
	}

}
